{# keep this file sync'ed with 'squad/frontend/templates/squad/_user_menu.jinja2' #}

{% load squad %}
{% load i18n %}

{% if user.is_authenticated %}
  <li>
      <a class="dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
        <img src="{% avatar_url user.email 20 %}" class='avatar-sm'/>
        <span class="caret"></span>
      </a>
      <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
        <li>
          <div>
            {% blocktrans with '<strong>'|add:user.username|add:'</strong>'|safe as username %}Signed in as {{ username }}{% endblocktrans %}
          </div>
        </li>
        {% if user.is_staff %}
          <li role="separator" class="divider"></li>
          <li><a href="/admin/">{{ _('Administration') }}</a></li>
        {% endif %}
        <li role="separator" class="divider"></li>
        <li><a href="{% url 'settings-home' %}">{{ _('Settings')}}</a></li>
        <li><a href="/logout">{{ _('Sign out') }}</a></li>
      </ul>
  </li>
{% else %}
  <li>
    <a href="/login/?next={{request.path}}"><i class='fa fa-sign-in'></i> {{ _('Log in') }}</a>
  </li>
{% endif %}
